<table width="90%" id="linkgoods-table" align="center">
	<tbody>
		<tr>
			<td colspan="3">
				<img src="__PUBLIC__/image/admin/icon_search.gif" width="26" height="22" border="0" alt="SEARCH">
				<select name="cat_id1">
					<option value="0">所有分类</option>
					<option value="0">请选择...</option>
					<volist name="goodsCatList" id="goodsCat">
						<option value="{$goodsCat.cat_id}">{$goodsCat.cat_name}</option>
					</volist>
				</select>
				<select name="brand_id1">					
					<option value="0">所有品牌</option>
					<volist name="brand_list" id="brand">
						<option value="{$key}">{$brand}</option>
					</volist>
				</select>				
				<input type="text" class="qs-input" name="keyword1">
				<input type="button" class="qs-btn" value=" 搜索 " onclick="searchGoods(sz1, 'cat_id1','brand_id1','keyword1')">
			</td>
		</tr>
		<tr>
			<th>可选商品</th>
			<th>操作</th>
			<th>跟该商品关联的商品</th>
		</tr>
		<tr>
			<td width="42%">
				<select name="source_select1" size="20" style="width:100%" ondblclick="sz1.addItem(false, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)" multiple="true">
				</select>
			</td>
			<td align="center">
				<p>
					<input name="is_single" type="radio" value="1" checked="checked">单向关联<br>
					<input name="is_single" type="radio" value="0">双向关联
				</p>
				<p>
					<input type="button" value=">>" onclick="sz1.addItem(true, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)">
				</p>
				<p>
					<input type="button" value=">" onclick="sz1.addItem(false, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)">
				</p>
				<p>
					<input type="button" value="<" onclick="sz1.dropItem(false, 'drop_link_goods', goodsId, elements['is_single'][0].checked)" >
				</p>
				<p>
					<input type="button" value="<<" onclick="sz1.dropItem(true, 'drop_link_goods', goodsId, elements['is_single'][0].checked)" >
				</p>
			</td>
			<td width="42%">
				<select name="target_select1" size="20" style="width:100%" multiple="" ondblclick="sz1.dropItem(false, 'drop_link_goods', goodsId, elements['is_single'][0].checked)">
					<volist name="link_goods_list" id="link_goods">
						<option value="{$link_goods.goods_id}" id="{$link_goods.shop_price}">{$link_goods.goods_name}</option>
					</volist>
				</select>
			</td>
		</tr>
	</tbody>
</table>

<script>	
	/* 搜索商品 */
	function searchGoods(szObject, catId, brandId, keyword){
		var filters = new Object;
		filters.cat_id = elements[catId].value;
		filters.brand_id = elements[brandId].value;
		filters.keyword = Utils.trim(elements[keyword].value);
		filters.exclude = document.forms['theForm'].elements['goods_id'].value;	
		//szObject.loadOptions('get_goods_list', filters);
		$.ajax({
			type: "get",
			url: "__URL__/get_goods_list",
			data:filters,
			beforeSend: function(XMLHttpRequest){
				/*ShowLoading();*/
			},
			success: function(data, textStatus){
				//alert(data);
				//$('#tbody-goodsAttr').html(data);
				szObject.loadOptionsResponse(data,textStatus);
			},
			complete: function(XMLHttpRequest, textStatus){
				/*HideLoading();*/
			},
			error: function(){
				/*请求出错处理*/
			}			
		});
	}
</script>